<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>鼠标单击</title>
</head>
<body>
<div id="app">
    <button v-on:click="left">左键单击</button>
    <!--.right 修饰符处理鼠标右键单击-->
    <button v-on:click.right="right">右键单击</button>
    <!--.middle 修饰处理鼠标滚轮单击-->
    <button v-on:click.middle="middle">滚轮单击</button>

    <hr>
    <button v-on:click.left="left">左键单击</button>
</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                function left(event) {
                    console.log(event);
                }

                function right(event) {
                    console.log(event);
                }

                function middle(event) {
                    console.log(event);
                }

                return {
                    left,
                    right,
                    middle,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>